<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<jsp:include page="/common/commonCss.jsp"/>
<jsp:include page="/common/commonJs.jsp"/>
<script language="javascript" src="${basePath }commonJs/tags/My97DatePicker/WdatePicker.js"></script>
<script language="javascript" src="${basePath }commonJs/quinn_commons.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	excutePage();
	reprotTitle();
	$("#exportBtn").click(function() {
		$.messager.confirm('提示', '确定要导出吗？', function(r) {
			if (r) {
				$("#exportTime").val($("#searchTime").val());
				$("#exportForm").submit();
			}
		});
	});
});
function select11(){
	$("#searchForm input:hidden[name='pageNo']").val(1);
	excutePage();
}

function reprotTitle(){
	var time = $("#searchTime").val().replace('/','.');
	$("#reportTitle").html('<b>'+time+' 派对预付统计</b>');
}

//分页
function excutePage(){
	//设置报表标题
	reprotTitle();
	 var form = $("#searchForm"); //获取一个form的jquery对象
     var pagebean = new PageBean(form); //实例化一个Pagebean对象，并且设置form对象
     pagebean.setTableId("table1"); //设置要分页的table的id属性
     pagebean.setCallback(initTable); //回调函数
     pagebean.setFootId("pagefoot"); //foot div的id
     setPagebeanObj(pagebean); //全局化pageBean对象
     pagebean.doPage(); 
 } 
//回调函数,只有一个参数，data为返回数据结果集，也就是MyBatisSuperModel里的results
//开发人员需要在此函数里写自己的数据填充逻辑,把数据拼到table里
//注意:分页插件会把table除了第一行和最后一行都删掉，这里填充数据时需要从第二行开始填充
function initTable(data) {
       $.each(data, function(ind, obj) {
    	   			obj = emptyJson(obj);
                    var htm = "<tr>";
                    htm += "<td>" + obj.fkMemId + "</td>";
                    htm += "<td>" + obj.memName + "</td>";
                    htm += "<td>" + obj.conName + "</td>";
                    htm += "<td>" + obj.paidAmount + "</td>";
                    htm += "<td>" + obj.payDateStr + "</td>";
                    htm += "<td>" + obj.resDateStr + "</td>";
                    htm += "<td>" + obj.comments + "</td>";
                    htm += "</tr>";
                    $("#table1").find("tr:eq("+ind+")").after(htm);
       });
  }
function go() {
	window.location.href = "${basePath}report/jump.shtml?key=" + $("#report_type").val();
}
</script>
<title>报表管理</title>
</head>
<body class="bg">

<div class="content m_auto">
	<%@include file="reprot_tab.jsp"%>
    <div class="content_r mt10">
    <div class="tab_normal m10">
    <div class="file_single_dl f14 fixed">
			<br />
			<form action="${basePath}report/home.shtml" method="post" id="searchForm" name="searchForm">
    			<input type="hidden" name="pageSize" value="10" />
    			<input type="hidden" name="pageNo" value="1" /> 
			<dl style="overflow:hidden" class="fixed">
				<dd>
					<label>报表类型：</label>
					<div class="uboxstyle">
						<select name="reportName" id="report_type" onchange="go()">
							<option value="dailyIncome">日常收益报表</option>
							<option value="membershipSale">会籍销售统计报表</option>
							<option value="membership">会籍统计报表</option>
							<option value="partyOrGroup">派对团体统计报表</option>
							<option value="scmCount">进场人数统计报表</option>
							<option value="membershipProfit">会籍利润报表</option>
							<option value="membershipValue">会员储值报表</option>
							<option value="partyPrepaid" selected = "selected">派对预付报表</option>
							<option value="failureMember">会员失效报表</option>
						</select>
					</div>
				</dd>
				<dd><label>日期：</label>
					<input type="text" readonly="readonly" class="Wdate iput_t w82" onclick="WdatePicker({dateFmt:'yyyy.MM ',isShowWeek:true,isShowClear:true,readOnly:true})" id="searchTime" name="searchTime" title="" />
				</dd>
			</dl>
			</form> 
			 <div>
            	<input type="button" id="searchBtn" class="btn fr m010" value="查询" onclick="select11();" />
            	<form action="${basePath}report/export.shtml" method="post" id="exportForm" name="exportForm">
            		<input type="hidden" name="reportName" value="partyPrepaid"/>
            		<input type="hidden" name="searchTime" id="exportTime" />
            		<input type="button" id="exportBtn" class="btn fr m010"  value="导出" />
            	</form>
             </div>
		</div>
		<br />
    	
    <br />
    		<div id="reportTitle" style="text-align:center;font-size:18px;font-weight:blod;"></div><br />
			<div style="text-align:center;font-size:12px;font-weight:blod;"><b>统计时间：${countedTime} 统计人：${countedUser }</b></div><br />
			<table class="table" id="table1">
				<tr>
					<th>会员号</th>
					<th>姓名</th>
					<th>联系人</th>
					<th>储值金额</th>
					<th>储值日期</th>
					<th>派对日期</th>
					<th>备注</th>
				</tr>
			</table>
			<!---翻页-->
            <div class="page fr m10" id="pagefoot">
            </div>
            </div>
</div>
</div>
</body>
</html>